
(in-package #:smugmug)

;;; find an album and return image info for all images contained in
;;; the album

(let* ((session (login-with-password "username" "password" "apikey"))
       (album (find "Lemonade" (get-albums session) :key #'title :test #'string=)))
  (mapcar #'get-image-info (get-images album)))

;;; login using the hash login method and upload images to an album

(let ((*smugmug-rest-url* (puri:parse-uri "http://api.smugmug.com/hack/rest/1.2.0/")))
  (let ((session (login-with-hash "id" "hash" "apikey")))
    (let* ((category (find "Family" (get-categories session) :key #'title :test #'string=))
           (album (create-album category "Tipi")))
      (dolist (pathname (cl-fad:list-directory 
                         (merge-pathnames #"camera/" (user-homedir-pathname))))
        (format t "~&Uploading ~S to ~S" pathname album)
        (upload pathname album)))))
